package com.schoolcardinfo.biz.impl;

import java.util.ArrayList;
import java.util.List;

import com.schoolcardinfo.beans.Id_Admin;
import com.schoolcardinfo.biz.IId_AdminBiz;
import com.schoolcardinfo.dao.DBHelper;

public class Id_AdminBizImpl implements IId_AdminBiz{
	private DBHelper db=new DBHelper();
	@Override
	public Id_Admin adminLogin(int adminId, String password) {
		String sql="select * from id_admin where adminId=? and password=?";
		List<Object> params=new ArrayList<Object>();
		params.add(adminId);
		params.add(password);
		System.out.println(params);
		List<Id_Admin> list=db.find(sql, params, Id_Admin.class);
		if(list.size()>0){
			Id_Admin ia=db.find(sql, params, Id_Admin.class).get(0);
			return ia;
		}else{
			return null;
		}
	}

}
